package du.myseckill.service.Impl;

import com.alibaba.fastjson.JSON;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SecKillMQProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendSecKillMessage(Object msg){
        rabbitTemplate.convertAndSend("secKill_fanout_exchange","", JSON.toJSONString(msg));
    }
}
